package com.jxzyk.model;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.jxzyk.adapter.OutlineAdapter;

public class WebActivity extends Activity {
	private String url;

	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		// 隐藏标题栏
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		// 隐藏状态栏
		// 定义全屏参数
		int flag = WindowManager.LayoutParams.FLAG_FULLSCREEN;
		// 获得当前窗体对象
		Window window = WebActivity.this.getWindow();
		// 设置当前窗体为全屏显示
		window.setFlags(flag, flag);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
		bundle = getIntent().getExtras();
		url = bundle.getString(OutlineAdapter.TAG);
		WebView webView = new WebView(getBaseContext());
		setContentView(webView);

		WebSettings settings = webView.getSettings();
		// settings.setPluginsEnabled(true);
		settings.setJavaScriptEnabled(true);
		settings.setAllowFileAccess(true);
		settings.setDefaultTextEncodingName("GBK");
		webView.setBackgroundColor(0);
		webView.loadUrl(url);
	}

}
